﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace TPCN.DAL
{
   public class ChiTietHoaDonBanObj
    {
        private string _ChitiethoadonbanID;

        public string ChitiethoadonbanID
        {
            get { return _ChitiethoadonbanID; }
            set { _ChitiethoadonbanID = value; }
        }
        private string _HoadonbanID;

        public string HoadonbanID
        {
            get { return _HoadonbanID; }
            set { _HoadonbanID = value; }
        }
        private string _HangID;

        public string HangID
        {
            get { return _HangID; }
            set { _HangID = value; }
        }
        private string _Soluong;

        public string Soluong
        {
            get { return _Soluong; }
            set { _Soluong = value; }
        }
        private string _Dongia;

        public string Dongia
        {
            get { return _Dongia; }
            set { _Dongia = value; }
        }
        private string _Ghichu;

        public string Ghichu
        {
            get { return _Ghichu; }
            set { _Ghichu = value; }
        }
        private string _Chietkhau;

        public string Chietkhau
        {
            get { return _Chietkhau; }
            set { _Chietkhau = value; }
        }
        private string _Hinhthucchietkhau;

        public string Hinhthucchietkhau
        {
            get { return _Hinhthucchietkhau; }
            set { _Hinhthucchietkhau = value; }
        }
        private string _Noidungchietkhau;

        public string Noidungchietkhau
        {
            get { return _Noidungchietkhau; }
            set { _Noidungchietkhau = value; }
        }
        public ChiTietHoaDonBanObj SetValuesFromDataReader(IDataReader reader)
        {
            ChiTietHoaDonBanObj obj = new ChiTietHoaDonBanObj();
            obj.ChitiethoadonbanID = (reader["ChitiethoadonbanID"] is DBNull) ? String.Empty : reader["ChitiethoadonbanID"].ToString();
            obj.HoadonbanID = (reader["HoadonbanID"] is DBNull) ? String.Empty : reader["HoadonbanID"].ToString();
            obj.HangID = (reader["HangID"] is DBNull) ? String.Empty : reader["HangID"].ToString();
            obj.Soluong = (reader["Soluong"] is DBNull) ? "0" : reader["Soluong"].ToString();
            obj.Dongia = (reader["Dongia"] is DBNull) ? "0" : reader["Dongia"].ToString();
            obj.Ghichu = (reader["Ghichu"] is DBNull) ? String.Empty : reader["Ghichu"].ToString();
            obj.Chietkhau = (reader["Chietkhau"] is DBNull) ? "0" : reader["Chietkhau"].ToString();
            obj.Hinhthucchietkhau = (reader["Hinhthucchietkhau"] is DBNull) ? String.Empty : reader["Hinhthucchietkhau"].ToString();
            obj.Noidungchietkhau = (reader["Noidungchietkhau"] is DBNull) ? String.Empty : reader["Noidungchietkhau"].ToString();
            return obj;
        }
    }
}
